#ifndef _PBVP_RENDER_PLUGING_H
#define _PBVP_RENDER_PLUGING_H

#include <QtPlugin>
#include <QWidget>
#include "../plugin.h"
#include "../data/datainterface.h"

namespace PBVP {
	class DataNode;
	/// 
	class RenderPlugin : public Plugin {
	public:
		RenderPlugin() {}
		///
		virtual ~RenderPlugin() { }

		/// 
		virtual QString description() const {
			return QString("Renderer Plugin Base");
		}

		/* RenderPlugin Specific functions */
		/// 
		virtual RenderPlugin* clone() = 0;
		/// Initialize the Render plugin.
		/** 
		 * If it returns false, this plugin should not be loaded
		 */
		virtual bool initRender() { return true; }
		/// Is given data type supported by the renderer
		virtual bool isSupported(DataInterface *pData) const { return false; }
		/// Begin the rendering using this Renderer
		/** 
		 * This function sets up rendering attributes before each rendering
		 */
		virtual void begin() {}
		/// End the rendering of the current Renderer
		virtual void end() {}
		/// Rendering function
		virtual void render(DataNode* pDataNode) {}
		///
		virtual void setDataNode(DataNode *pDataNode) {}
		/// Reset all default settings 
		virtual void reset() {}
		/// Return the control widget of the renderer
		virtual QWidget* getRenderControl() const {
			return NULL;
		}

	};

}

Q_DECLARE_INTERFACE(PBVP::RenderPlugin, "PBVP.RenderPluginInterface/1.0")

#endif